﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};

	var cols = [
	{col:{header:'节点ID', width:77, sortable:true}, field:{name:'wf_order_node__node_id',type:'string'}},
	{col:{header:'节点名称', width:129, sortable:true}, field:{name:'wf_order_node__node_title',type:'string'}},
	{col:{header:'节点类型', width:100, sortable:true}, field:{name:'wf_order_node__node_type',type:'string'}},
	{col:{header:'位置高度', width:80, sortable:true, align:'right',
		editable:true, hcss:'color:#2E6DA4;',
		editor:new Ext.form.NumberField({
			decimalPrecision:0, maxLength:22
		}),renderer:JxUtil.formatInt()}, field:{name:'wf_order_node__edit_height',type:'int'}},
	{col:{header:'可编辑URL', width:231, sortable:true, editable:true, hcss:'color:#2E6DA4;',
		editor:new Ext.form.TextField({
			maxLength:200
		})}, field:{name:'wf_order_node__check_url',type:'string'}},
	{col:{header:'字段Render', width:192, sortable:true, editable:true, hcss:'color:#2E6DA4;',
		editor:new Ext.form.TextField({
			maxLength:1000
		})}, field:{name:'wf_order_node__field_render',type:'string'}},
	{col:{header:'审批单据ID', width:100, sortable:true, colindex:10000, hidden:true}, field:{name:'wf_order_node__order_id',type:'string'}},
	{col:{header:'主键', width:100, sortable:true, colindex:10000, hidden:true}, field:{name:'wf_order_node__wf_nodeid',type:'string'}}
	];
	
	config.param = {
		cols: cols,
		sorts: null,
		hasQuery: '1',
		isedit: '1',
		isshow: '1',
		funid: 'wf_order_node'
	};
	
	
	config.eventcfg = {		
	dataImportParam: function() {
		var pg = JxUtil.getParentGrid(this.grid);
		var records = pg.getSelectionModel().getSelections();
		if (!JxUtil.selectone(records)) return;
		
        var fkey = records[0].get('wf_order__order_id');
		var funId = records[0].get('wf_order__fun_id');
		
		var options = {
			whereSql: 'process_id in (select process_id from wf_process where process_state = ? and fun_id = ?) and node_id not in (select node_id from wf_order_node where order_id = ?)',
			whereValue: '2;'+funId+';'+fkey,
			whereType: 'string;string;string'
		};
        
		return options;
	}
};
		
	return new Jxstar.GridNode(config);
}